/**
 * FileName: MyTest
 * Author:   Wucb
 * Date:     2019/8/27 14:39
 * Description: 测试类
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.onesports.hello.spring;

import com.onesports.hello.spring.service.IUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 〈一句话功能简述〉<br> 
 * 〈测试类〉
 *
 * @author Wucb
 * @create 2019/8/27
 * @since 1.0.0
 */
public class MyTest {

    private static final Logger logger = LoggerFactory.getLogger(MyTest.class);

    public static void main(String[] args) {

        //获取Spring容器
        ApplicationContext applicationContext =
                new ClassPathXmlApplicationContext("spring-context.xml");
        //从容器中获取对象
        IUserService userService = (IUserService) applicationContext.getBean("userService");
        userService.say();

        logger.info("info 级别的日志");
        logger.debug("debug 级别的日志");
        logger.warn("warn 级别的日志");
        logger.error("error 级别的日志");

        String msg1 = "测试1";
        String msg2 = "测试2";
        logger.info("message id {},{}",msg1,msg2);

        System.out.println(String.format("message is : %s  %s",msg1,msg2));
        System.out.println(msg1.concat(msg2));

    }
}
